5.1.1 Create and withdraw digital currency to any wallet
#Brief description: Withdraw digital currency to the wallet's withdrawal business interface, allowing users to transfer usdt to the specified wallet address (market exchange rate)
- Request method: POST
- Request interface: https://gateway-domain/wallet-trade-merchant/v1/pay/blockchain/create
- Request media type (JSON data format)Content-Type: application/json
Request parameters
| Parameter name | Type | Required | Parameter meaning | Parameter description |
|---|---|---|---|---|
key | string | Yes | Merchant key | apiKey |
localOrderId | string | Yes | Merchant platform local order number | Merchant platform generates unique order number locally |
localUserId | string | No | Merchant platform local user ID | Merchant platform local user ID |
amount | number | Yes | Amount | Order Amount |
network | string | Yes | Mainnet | Mainnet (currently only supports TRON, BSC, POLYGON, ETHEREUM) |
address | string | Yes | Withdrawal Address | Withdrawal Address |
notifyUrl | string | No | Callback address | After the order is successfully placed, the merchant's address will be notified by the API callback request (for callback details, please refer to Document 3) |
currency | string | Yes | Currency | Order Currency |
userCurrency | string | Yes | The currency actually received by the user | The currency actually received by the user |
successRedirectUrl | string | No | Address | Automatically jump to the address after success |
isBlockchain | boolean | No | Whether to return blockchain information (default false) | When true, the callback request will carry the transaction information on the order chain |
expireSecond | Long | No | Expiration timestamp (seconds) | |
sign | string | Yes | Signature | See Signature Algorithm for details |
Request json sample
{
"key": "weOfDMRpUAvAeOs5",
"localOrderId": "TestOTM0625ROB017",
"notifyUrl": "http://www.baidu.com/728-TestOTM0625ROB01",
"amount": 20,
"network": "TRON",
"currency": "CNY",
"userCurrency": "USDT",
"successRedirectUrl": "http://www.baidu.com",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"isBlockchain": true,
"sign": "834e924f7846fe3a65b53e6680c8e53a"
}
Response json example
{
"code": 0,
"success": true,
"message": null,
"data": {
"orderId": 473220978729221,
"localUserId": null,
"localOrderId": "TestOTM0625ROB017",
"orderType": "WITHDRAW",
"orderBizType": "WITHDRAW_ANY_DIGITAL_WALLET",
"targetType": "EXTERNAL",
"network": "TRON",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "20",
"userAmount": "2.994723",
"userReceivableAmount": "2.994723",
"rate": "6.67841204",
"rateExpression": "1USDT≈6.6784CNY"
}
}
Response data parameter description
| Parameter name | Type | Parameter meaning | Remarks |
|---|---|---|---|
orderId | string | Order ID | |
localUserId | string | Merchant local user ID | |
localOrderId | string | Merchant local order number | |
orderType | enum | Order Type | PAYMENT:支付订单 | WITHDRAW:提款订单 |
orderBizType | enum | Order business type | orderBizType type description is as follows |
targetType | enum | Target type | targetType type description is as follows |
network | string | Mainnet type | |
address | string | Address | On-chain payment address |
currency | string | Order currency | |
userCurrency | string | Arrival currency | |
amount | string | Order amount | |
userAmount | string | Amount paid by the user | |
userReceivableAmount | string | User receivable amount | |
rate | string | Exchange rate | |
rateExpression | string | Exchange rate expression |
orderBizType type description:
- PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
- PAYMENT_TRANSFER digital currency binding address direct deposit
- PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
- WITHDRAW_WALLET withdraw money to MINPAY wallet
- WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
- PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
- BATCH_PAY batch payment
targetType type description:
- INTERNAL internal address
- EXTERNAL external address
- USER user abstract address
Callback returns json data
By default, all callback parameters participate in signature verification. For details of callback parameters, please see callback ]
Callback data
{
"amount":"20",
"bizType":"WITHDRAW_ANY_DIGITAL_WALLET",
"blockchain":{
"network":"TRON",
"receiverAddress":"TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"senderAddress":"TE35TrUfHjbGEBsVS6zVXdHS8HxXCWwC2y",
"txId":"c5503ecf1f0979d5bc7a7e16c3cad20290449913ab47a7e18dfca6ba6f2725fa"
},
"currency":"CNY",
"localOrderId":"TestOTM0625ROB017",
"merchantActualAmount":"57.32",
"merchantCurrency":"CNY",
"merchantId":302992856974,
"merchantPaidAmount":"20",
"notifyTime":1772259079786,
"orderCreateTime":1772259032870,
"orderId":"473220978729221",
"status":"SUCCESS",
"type":"WITHDRAW",
"userAmount":"2.994723",
"userCurrency":"USDT",
"userMinerFee":"0",
"userReceivableAmount":"2.994723",
"sign":"742e64d684648c32c7ad33cf8d5604e2",
"key":"9yUreYgTRtit39Dy"
}
When you receive the callback notification, please directly return the string success after the processing is completed, indicating that the message has been successfully received and processed. After the system receives the success response, it will no longer send the callback repeatedly. If the expected response is not received (success is not returned or an exception is returned), the system will resend the callback notification according to the stepped retry mechanism, retrying up to 14 times. The current retry intervals are: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s